<?php
/**
 * Author: LaiGuiming
 * Time: 2017-08-30 17:45:32
 * Copyright (C) 2016 Longyan Wehome Message CO.,LTD.
 */

namespace app\admin\controller;
use app\common\controller\BackEnd;

/**
 * 报表统计控制器
 * Class Report
 * @package app\admin\controller
 */
class Report extends BackEnd
{
    public function testView(){
        return $this->fetch();
    }

    /**
     * 测试报表
     * @param int $limit
     * @param int $offset
     */
    public function testData($limit = 10,$offset=0)
    {
        $model=D('test');
        $where="status!=2";
        $where=$this->getCondition($where,"name","like");
        $counts=$model->where($where)->count();
        $data=$model->where($where)->order('ct desc')->limit($offset,$limit)->select();
        $res = array("rows" => $data, "total" => $counts);
        echo json_encode($res);
    }
}